<?php
/**
 * 获取节点path名称
 * @param array $argv       
 * @param id $argv['id']                节点ID
 * @param string $argv['pid_path']      节点路径
 * @return string
 */
function get_node_path($argv=[]){
    // 条件
    if(array_key_exists('id', $argv) && $argv['id']){
        $pid_path = D('Common', 'Logic')->getField('auth_rule', 'pid_path', ['id'=>$argv['id'], 'status'=>['neq', 99]]);
    }else if(array_key_exists('pid_path', $argv) && $argv['pid_path']){
        $pid_path = $argv['pid_path'];
    }
    
    // 路径
    if($pid_path){
        $nodes_title = D('Common', 'Logic')->getFields('auth_rule', 'title', ['id' => ['in', $pid_path], 'status'=>['neq', 99]]);
        $path_name = implode(C('PATH_INFO_FLAG'), array_column($nodes_title, 'title'));
    }
    
    return $path_name ? $path_name : '';
}
